home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / tecmo.c < prev    next >
C/C++ Source or Header  |  2000-05-04  |  38KB  |  1,040 lines

  1. /***************************************************************************
  2.  
  3. tecmo.c
  4.  
  5. M68000 based Tecmo games (Final Starforce) may fit in here as well
  6.  
  7. driver by Nicola Salmoria
  8.  
  9.  
  10. Silkworm memory map (preliminary)
  11.  
  12. 0000-bfff ROM
  13. c000-c1ff Background video RAM #2
  14. c200-c3ff Background color RAM #2
  15. c400-c5ff Background video RAM #1
  16. c600-c7ff Background color RAM #1
  17. c800-cbff Video RAM
  18. cc00-cfff Color RAM
  19. d000-dfff RAM
  20. e000-e7ff Sprites
  21. e800-efff Palette RAM, groups of 2 bytes, 4 bits per gun: xB RG
  22.           e800-e9ff sprites
  23.           ea00-ebff characters
  24.           ec00-edff bg #1
  25.           ee00-efff bg #2
  26. f000-f7ff window for banked ROM
  27.  
  28. read:
  29. f800      IN0 (heli) bit 0-3
  30. f801      IN0 bit 4-7
  31. f802      IN1 (jeep) bit 0-3
  32. f803      IN1 bit 4-7
  33. f806      DSWA bit 0-3
  34. f807      DSWA bit 4-7
  35. f808      DSWB bit 0-3
  36. f809      DSWB bit 4-7
  37. f80f      COIN
  38.  
  39. write:
  40. f800-f801 bg #1 x scroll
  41. f802      bg #1 y scroll
  42. f803-f804 bg #2 x scroll
  43. f805      bg #2 y scroll
  44. f806      ????
  45. f808      ROM bank selector
  46. f809      ????
  47. f80b      ????
  48.  
  49. ***************************************************************************
  50.  
  51. Rygar memory map (preliminary)
  52.  
  53. read:
  54. f800    player #1 joystick
  55. f801    player #1 buttons; service
  56. f802    player #2 joystick (mirror player#1 - since players take turns)
  57. f803    player #2 buttons (cocktail mode reads these)
  58. f804    start, coins
  59. f806    DSWA
  60. f807    DSWA cocktail
  61. f808    DSWB
  62. f809    DSWB
  63.  
  64. ***************************************************************************/
  65. #include "driver.h"
  66. #include "vidhrdw/generic.h"
  67. #include "cpu/z80/z80.h"
  68.  
  69.  
  70.  
  71. WRITE_HANDLER( tecmo_bankswitch_w );
  72. READ_HANDLER( tecmo_bankedrom_r );
  73.  
  74.  
  75.  
  76. WRITE_HANDLER( tecmo_bankswitch_w )
  77. {
  78.     int bankaddress;
  79.     unsigned char *RAM = memory_region(REGION_CPU1);
  80.  
  81.  
  82.     bankaddress = 0x10000 + ((data & 0xf8) << 8);
  83.     cpu_setbank(1,&RAM[bankaddress]);
  84. }
  85.  
  86. static WRITE_HANDLER( tecmo_sound_command_w )
  87. {
  88.     soundlatch_w(offset,data);
  89.     cpu_cause_interrupt(1,Z80_NMI_INT);
  90. }
  91.  
  92. static int adpcm_start,adpcm_end;
  93.  
  94. static WRITE_HANDLER( tecmo_adpcm_start_w )
  95. {
  96.     adpcm_start = data << 8;
  97. }
  98. static WRITE_HANDLER( tecmo_adpcm_end_w )
  99. {
  100.     adpcm_end = (data + 1) << 8;
  101. }
  102. static WRITE_HANDLER( tecmo_adpcm_trigger_w )
  103. {
  104.     ADPCM_setvol(0,(data & 0x0f) * 0x11);
  105.     if (data & 0x0f)    /* maybe this selects the volume? */
  106.         if (adpcm_start < 0x8000)
  107.             ADPCM_play(0,adpcm_start,(adpcm_end - adpcm_start)*2);
  108. }
  109.  
  110.  
  111.  
  112. extern unsigned char *tecmo_videoram,*tecmo_colorram;
  113. extern unsigned char *tecmo_videoram2,*tecmo_colorram2;
  114. extern unsigned char *tecmo_scroll;
  115. extern size_t tecmo_videoram2_size;
  116.  
  117. WRITE_HANDLER( tecmo_videoram_w );
  118. WRITE_HANDLER( tecmo_colorram_w );
  119.  
  120. int rygar_vh_start(void);
  121. int silkworm_vh_start(void);
  122. int gemini_vh_start(void);
  123.  
  124. void tecmo_vh_stop(void);
  125. void tecmo_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  126.  
  127.  
  128.  
  129. static struct MemoryReadAddress readmem[] =
  130. {
  131.     { 0x0000, 0xbfff, MRA_ROM },
  132.     { 0xc000, 0xefff, MRA_RAM },
  133.     { 0xf000, 0xf7ff, MRA_BANK1 },
  134.     { 0xf800, 0xf800, input_port_0_r },
  135.     { 0xf801, 0xf801, input_port_1_r },
  136.     { 0xf802, 0xf802, input_port_2_r },
  137.     { 0xf803, 0xf803, input_port_3_r },
  138.     { 0xf804, 0xf804, input_port_4_r },
  139.     { 0xf805, 0xf805, input_port_5_r },
  140.     { 0xf806, 0xf806, input_port_6_r },
  141.     { 0xf807, 0xf807, input_port_7_r },
  142.     { 0xf808, 0xf808, input_port_8_r },
  143.     { 0xf809, 0xf809, input_port_9_r },
  144.     { 0xf80f, 0xf80f, input_port_10_r },
  145.     { -1 }    /* end of table */
  146. };
  147.  
  148. static struct MemoryWriteAddress silkworm_writemem[] =
  149. {
  150.     { 0x0000, 0xbfff, MWA_ROM },
  151.     { 0xc000, 0xc1ff, videoram_w, &videoram, &videoram_size },
  152.     { 0xc200, 0xc3ff, colorram_w, &colorram },
  153.     { 0xc400, 0xc5ff, tecmo_videoram_w, &tecmo_videoram },
  154.     { 0xc600, 0xc7ff, tecmo_colorram_w, &tecmo_colorram },
  155.     { 0xc800, 0xcbff, MWA_RAM, &tecmo_videoram2, &tecmo_videoram2_size },
  156.     { 0xcc00, 0xcfff, MWA_RAM, &tecmo_colorram2 },
  157.     { 0xd000, 0xdfff, MWA_RAM },
  158.     { 0xe000, 0xe7ff, MWA_RAM, &spriteram, &spriteram_size },
  159.     { 0xe800, 0xefff, paletteram_xxxxBBBBRRRRGGGG_swap_w, &paletteram },
  160.     { 0xf000, 0xf7ff, MWA_ROM },
  161.     { 0xf800, 0xf805, MWA_RAM, &tecmo_scroll },
  162.     { 0xf806, 0xf806, tecmo_sound_command_w },
  163.     { 0xf807, 0xf807, MWA_NOP },    /* ???? */
  164.     { 0xf808, 0xf808, tecmo_bankswitch_w },
  165.     { 0xf809, 0xf809, MWA_NOP },    /* ???? */
  166.     { 0xf80b, 0xf80b, MWA_NOP },    /* ???? */
  167.     { -1 }    /* end of table */
  168. };
  169.  
  170. static struct MemoryWriteAddress rygar_writemem[] =
  171. {
  172.     { 0x0000, 0xbfff, MWA_ROM },
  173.     { 0xc000, 0xcfff, MWA_RAM },
  174.     { 0xd000, 0xd3ff, MWA_RAM, &tecmo_videoram2, &tecmo_videoram2_size },
  175.     { 0xd400, 0xd7ff, MWA_RAM, &tecmo_colorram2 },
  176.     { 0xd800, 0xd9ff, tecmo_videoram_w, &tecmo_videoram },
  177.     { 0xda00, 0xdbff, tecmo_colorram_w, &tecmo_colorram },
  178.     { 0xdc00, 0xddff, videoram_w, &videoram, &videoram_size },
  179.     { 0xde00, 0xdfff, colorram_w, &colorram },
  180.     { 0xe000, 0xe7ff, MWA_RAM, &spriteram, &spriteram_size },
  181.     { 0xe800, 0xefff, paletteram_xxxxBBBBRRRRGGGG_swap_w, &paletteram },
  182.     { 0xf000, 0xf7ff, MWA_ROM },
  183.     { 0xf800, 0xf805, MWA_RAM, &tecmo_scroll },
  184.     { 0xf806, 0xf806, tecmo_sound_command_w },
  185.     { 0xf807, 0xf807, MWA_NOP },    /* ???? */
  186.     { 0xf808, 0xf808, tecmo_bankswitch_w },
  187.     { 0xf809, 0xf809, MWA_NOP },    /* ???? */
  188.     { 0xf80b, 0xf80b, MWA_NOP },    /* ???? */
  189.     { -1 }    /* end of table */
  190. };
  191.  
  192. static struct MemoryWriteAddress gemini_writemem[] =
  193. {
  194.     { 0x0000, 0xbfff, MWA_ROM },
  195.     { 0xc000, 0xcfff, MWA_RAM },
  196.     { 0xd000, 0xd3ff, MWA_RAM, &tecmo_videoram2, &tecmo_videoram2_size },
  197.     { 0xd400, 0xd7ff, MWA_RAM, &tecmo_colorram2 },
  198.     { 0xd800, 0xd9ff, tecmo_videoram_w, &tecmo_videoram },
  199.     { 0xda00, 0xdbff, tecmo_colorram_w, &tecmo_colorram },
  200.     { 0xdc00, 0xddff, videoram_w, &videoram, &videoram_size },
  201.     { 0xde00, 0xdfff, colorram_w, &colorram },
  202.     { 0xe000, 0xe7ff, paletteram_xxxxBBBBRRRRGGGG_swap_w, &paletteram },
  203.     { 0xe800, 0xefff, MWA_RAM, &spriteram, &spriteram_size },
  204.     { 0xf000, 0xf7ff, MWA_ROM },
  205.     { 0xf800, 0xf805, MWA_RAM, &tecmo_scroll },
  206.     { 0xf806, 0xf806, tecmo_sound_command_w },
  207.     { 0xf807, 0xf807, MWA_NOP },    /* ???? */
  208.     { 0xf808, 0xf808, tecmo_bankswitch_w },
  209.     { 0xf809, 0xf809, MWA_NOP },    /* ???? */
  210.     { 0xf80b, 0xf80b, MWA_NOP },    /* ???? */
  211.     { -1 }    /* end of table */
  212. };
  213.  
  214. static struct MemoryReadAddress sound_readmem[] =
  215. {
  216.     { 0x0000, 0x7fff, MRA_ROM },
  217.     { 0x8000, 0x87ff, MRA_RAM },
  218.     { 0xc000, 0xc000, soundlatch_r },
  219.     { -1 }    /* end of table */
  220. };
  221.  
  222. static struct MemoryWriteAddress sound_writemem[] =
  223. {
  224.     { 0x2000, 0x207f, MWA_RAM },    /* Silkworm set #2 has a custom CPU which */
  225.                                     /* writes code to this area */
  226.     { 0x0000, 0x7fff, MWA_ROM },
  227.     { 0x8000, 0x87ff, MWA_RAM },
  228.     { 0xa000, 0xa000, YM3812_control_port_0_w },
  229.     { 0xa001, 0xa001, YM3812_write_port_0_w },
  230.     { 0xc000, 0xc000, tecmo_adpcm_start_w },
  231.     { 0xc400, 0xc400, tecmo_adpcm_end_w },
  232.     { 0xc800, 0xc800, tecmo_adpcm_trigger_w },
  233.     { 0xcc00, 0xcc00, MWA_NOP },    /* NMI acknowledge? */
  234.     { -1 }    /* end of table */
  235. };
  236.  
  237. static struct MemoryReadAddress rygar_sound_readmem[] =
  238. {
  239.     { 0x0000, 0x3fff, MRA_ROM },
  240.     { 0x4000, 0x47ff, MRA_RAM },
  241.     { 0xc000, 0xc000, soundlatch_r },
  242.     { -1 }    /* end of table */
  243. };
  244.  
  245. static struct MemoryWriteAddress rygar_sound_writemem[] =
  246. {
  247.     { 0x0000, 0x3fff, MWA_ROM },
  248.     { 0x4000, 0x47ff, MWA_RAM },
  249.     { 0x8000, 0x8000, YM3812_control_port_0_w },
  250.     { 0x8001, 0x8001, YM3812_write_port_0_w },
  251.     { 0xc000, 0xc000, tecmo_adpcm_start_w },
  252.     { 0xd000, 0xd000, tecmo_adpcm_end_w },
  253.     { 0xe000, 0xe000, tecmo_adpcm_trigger_w },
  254.     { 0xf000, 0xf000, MWA_NOP },    /* NMI acknowledge? */
  255.     { -1 }    /* end of table */
  256. };
  257.  
  258.  
  259.  
  260. INPUT_PORTS_START( rygar )
  261.     PORT_START    /* IN0 bits 0-3 */
  262.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_8WAY )
  263.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  264.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_8WAY )
  265.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_8WAY )
  266.  
  267.     PORT_START    /* IN1 bits 0-3 */
  268.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  269.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 )
  270.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 )
  271.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  272.  
  273.     PORT_START    /* IN2 bits 0-3 */
  274.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_COCKTAIL )
  275.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  276.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_COCKTAIL )
  277.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
  278.  
  279.     PORT_START    /* IN3 bits 0-3 */
  280.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  281.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_COCKTAIL )
  282.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  283.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  284.  
  285.     PORT_START    /* IN4 bits 0-3 */
  286.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START2 )
  287.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 )
  288.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 )
  289.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
  290.  
  291.     PORT_START    /* unused? */
  292.     PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  293.  
  294.     PORT_START    /* DSWA bit 0-3 */
  295.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
  296.     PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
  297.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  298.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
  299.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_3C ) )
  300.     PORT_DIPNAME( 0x0C, 0x00, DEF_STR( Coin_B ) )
  301.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
  302.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  303.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
  304.     PORT_DIPSETTING(    0x0C, DEF_STR( 1C_3C ) )
  305.  
  306.     PORT_START    /* DSWA bit 4-7 */
  307.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
  308.     PORT_DIPSETTING(    0x03, "2" )
  309.     PORT_DIPSETTING(    0x00, "3" )
  310.     PORT_DIPSETTING(    0x01, "4" )
  311.     PORT_DIPSETTING(    0x02, "5" )
  312.     PORT_DIPNAME( 0x04, 0x04, DEF_STR( Cabinet ) )
  313.     PORT_DIPSETTING(    0x04, DEF_STR( Upright ) )
  314.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
  315.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
  316.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  317.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  318.  
  319.     PORT_START    /* DSWB bit 0-3 */
  320.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Bonus_Life ) )
  321.     PORT_DIPSETTING(    0x00, "50000 200000 500000" )
  322.     PORT_DIPSETTING(    0x01, "100000 300000 600000" )
  323.     PORT_DIPSETTING(    0x02, "200000 500000" )
  324.     PORT_DIPSETTING(    0x03, "100000" )
  325.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
  326.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  327.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  328.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
  329.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  330.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  331.  
  332.     PORT_START    /* DSWB bit 4-7 */
  333.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
  334.     PORT_DIPSETTING(    0x00, "Easy" )
  335.     PORT_DIPSETTING(    0x01, "Normal" )
  336.     PORT_DIPSETTING(    0x02, "Hard" )
  337.     PORT_DIPSETTING(    0x03, "Hardest" )
  338.     PORT_DIPNAME( 0x04, 0x00, "2P Can Start Anytime" )
  339.     PORT_DIPSETTING(    0x00, DEF_STR( No ) )
  340.     PORT_DIPSETTING(    0x04, DEF_STR( Yes ) )
  341.     PORT_DIPNAME( 0x08, 0x08, "Allow Continue" )
  342.     PORT_DIPSETTING(    0x00, DEF_STR( No ) )
  343.     PORT_DIPSETTING(    0x08, DEF_STR( Yes ) )
  344.  
  345.     PORT_START    /* unused? */
  346.     PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  347. INPUT_PORTS_END
  348.  
  349. INPUT_PORTS_START( gemini )
  350.     PORT_START    /* IN0 bits 0-3 */
  351.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_8WAY )
  352.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  353.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_8WAY )
  354.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_8WAY )
  355.  
  356.     PORT_START    /* IN1 bits 0-3 */
  357.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 )
  358.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  359.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  360.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  361.  
  362.     PORT_START    /* IN2 bits 0-3 */
  363.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_COCKTAIL )
  364.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  365.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_COCKTAIL )
  366.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
  367.  
  368.     PORT_START    /* IN3 bits 0-3 */
  369.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_COCKTAIL )
  370.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  371.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  372.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  373.  
  374.     PORT_START    /* unused? */
  375.     PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  376.  
  377.     PORT_START    /* IN4 bits 0-3 */
  378.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  379.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  380.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
  381.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
  382.  
  383.     PORT_START    /* DSWA bit 0-3 */
  384.     PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coin_A ) )
  385.     PORT_DIPSETTING(    0x06, DEF_STR( 2C_1C ) )
  386.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  387.     PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) )
  388.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
  389.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
  390.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )
  391.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_5C ) )
  392.     PORT_DIPSETTING(    0x05, DEF_STR( 1C_6C ) )
  393.     PORT_DIPNAME( 0x08, 0x00, "Final Round Continuation" )
  394.     PORT_DIPSETTING(    0x00, "Round 6" )
  395.     PORT_DIPSETTING(    0x08, "Round 7" )
  396.  
  397.     PORT_START    /* DSWA bit 4-7 */
  398.     PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coin_B ) )
  399.     PORT_DIPSETTING(    0x06, DEF_STR( 2C_1C ) )
  400.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  401.     PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) )
  402.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
  403.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
  404.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )
  405.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_5C ) )
  406.     PORT_DIPSETTING(    0x05, DEF_STR( 1C_6C ) )
  407.     PORT_DIPNAME( 0x08, 0x00, "Buy in During Final Round" )
  408.     PORT_DIPSETTING(    0x00, DEF_STR( No ) )
  409.     PORT_DIPSETTING(    0x08, DEF_STR( Yes ) )
  410.  
  411.     PORT_START    /* DSWB bit 0-3 */
  412.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
  413.     PORT_DIPSETTING(    0x03, "2" )
  414.     PORT_DIPSETTING(    0x00, "3" )
  415.     PORT_DIPSETTING(    0x01, "4" )
  416.     PORT_DIPSETTING(    0x02, "5" )
  417.     PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Difficulty ) )
  418.     PORT_DIPSETTING(    0x00, "Easy" )
  419.     PORT_DIPSETTING(    0x04, "Normal" )
  420.     PORT_DIPSETTING(    0x08, "Hard" )
  421.     PORT_DIPSETTING(    0x0c, "Hardest" )
  422.  
  423.     PORT_START    /* DSWB bit 4-7 */
  424.     PORT_DIPNAME( 0x07, 0x00, DEF_STR( Bonus_Life ) )
  425.     PORT_DIPSETTING(    0x00, "50000 200000" )
  426.     PORT_DIPSETTING(    0x01, "50000 300000" )
  427.     PORT_DIPSETTING(    0x02, "100000 500000" )
  428.     PORT_DIPSETTING(    0x03, "50000" )
  429.     PORT_DIPSETTING(    0x04, "100000" )
  430.     PORT_DIPSETTING(    0x05, "200000" )
  431.     PORT_DIPSETTING(    0x06, "300000" )
  432.     PORT_DIPSETTING(    0x07, "None" )
  433.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) )
  434.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  435.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  436.  
  437.     PORT_START    /* unused? */
  438.     PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  439. INPUT_PORTS_END
  440.  
  441. INPUT_PORTS_START( silkworm )
  442.     PORT_START    /* IN0 bit 0-3 */
  443.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_8WAY )
  444.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  445.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_8WAY )
  446.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_8WAY )
  447.  
  448.     PORT_START    /* IN0 bit 4-7 */
  449.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 )
  450.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  451.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 )
  452.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* unused? */
  453.  
  454.     PORT_START    /* IN1 bit 0-3 */
  455.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_PLAYER2 )
  456.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  457.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_PLAYER2 )
  458.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_8WAY | IPF_PLAYER2 )
  459.  
  460.     PORT_START    /* IN1 bit 4-7 */
  461.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER2 )
  462.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2 )
  463.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 | IPF_PLAYER2 )
  464.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* unused? */
  465.  
  466.     PORT_START    /* unused? */
  467.     PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  468.  
  469.     PORT_START    /* unused? */
  470.     PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  471.  
  472.     PORT_START    /* DSWA bit 0-3 */
  473.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
  474.     PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
  475.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  476.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
  477.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_3C ) )
  478.     PORT_DIPNAME( 0x0C, 0x00, DEF_STR( Coin_B ) )
  479.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
  480.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  481.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
  482.     PORT_DIPSETTING(    0x0C, DEF_STR( 1C_3C ) )
  483.  
  484.     PORT_START    /* DSWA bit 4-7 */
  485.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
  486.     PORT_DIPSETTING(    0x03, "2" )
  487.     PORT_DIPSETTING(    0x00, "3" )
  488.     PORT_DIPSETTING(    0x01, "4" )
  489.     PORT_DIPSETTING(    0x02, "5" )
  490.     PORT_DIPNAME( 0x04, 0x00, "A 7" )    /* unused? */
  491.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  492.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  493.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
  494.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  495.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  496.  
  497.     PORT_START    /* DSWB bit 0-3 */
  498.     PORT_DIPNAME( 0x07, 0x00, DEF_STR( Bonus_Life ) )
  499.     PORT_DIPSETTING(    0x00, "50000 200000 500000" )
  500.     PORT_DIPSETTING(    0x01, "100000 300000 800000" )
  501.     PORT_DIPSETTING(    0x02, "50000 200000" )
  502.     PORT_DIPSETTING(    0x03, "100000 300000" )
  503.     PORT_DIPSETTING(    0x04, "50000" )
  504.     PORT_DIPSETTING(    0x05, "100000" )
  505.     PORT_DIPSETTING(    0x06, "200000" )
  506.     PORT_DIPSETTING(    0x07, "None" )
  507.     PORT_DIPNAME( 0x08, 0x00, "B 4" )    /* unused? */
  508.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  509.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  510.  
  511.     PORT_START    /* DSWB bit 4-7 */
  512.     PORT_DIPNAME( 0x07, 0x00, DEF_STR( Difficulty ) )
  513.     PORT_DIPSETTING(    0x00, "0" )
  514.     PORT_DIPSETTING(    0x01, "1" )
  515.     PORT_DIPSETTING(    0x02, "2" )
  516.     PORT_DIPSETTING(    0x03, "3" )
  517.     PORT_DIPSETTING(    0x04, "4" )
  518.     PORT_DIPSETTING(    0x05, "5" )
  519.     /* 0x06 and 0x07 are the same as 0x00 */
  520.     PORT_DIPNAME( 0x08, 0x00, "Allow Continue" )
  521.     PORT_DIPSETTING(    0x08, DEF_STR( No ) )
  522.     PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
  523.  
  524.     PORT_START    /* COIN */
  525.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  526.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  527.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
  528.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
  529. INPUT_PORTS_END
  530.  
  531.  
  532.  
  533. static struct GfxLayout tecmo_charlayout =
  534. {
  535.     8,8,    /* 8*8 characters */
  536.     1024,    /* 1024 characters */
  537.     4,    /* 4 bits per pixel */
  538.     { 0, 1, 2, 3 },    /* the bitplanes are packed in one nibble */
  539.     { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 },
  540.     { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
  541.     32*8    /* every char takes 32 consecutive bytes */
  542. };
  543.  
  544. static struct GfxLayout silkworm_spritelayout =
  545. {
  546.     16,16,    /* 16*16 sprites */
  547.     2048,    /* 2048 sprites */
  548.     4,    /* 4 bits per pixel */
  549.     { 0, 1, 2, 3 },    /* the bitplanes are packed in one nibble */
  550.     { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,
  551.             32*8+0*4, 32*8+1*4, 32*8+2*4, 32*8+3*4, 32*8+4*4, 32*8+5*4, 32*8+6*4, 32*8+7*4 },
  552.     { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
  553.             16*32, 17*32, 18*32, 19*32, 20*32, 21*32, 22*32, 23*32 },
  554.     128*8    /* every sprite takes 128 consecutive bytes */
  555. };
  556.  
  557. static struct GfxLayout silkworm_spritelayout2x =
  558. {
  559.     32,32,    /* 32*32 sprites */
  560.     512,    /* 512 sprites */
  561.     4,    /* 4 bits per pixel */
  562.     { 0, 1, 2, 3 },    /* the bitplanes are packed in one nibble */
  563.     { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,
  564.             32*8+0*4, 32*8+1*4, 32*8+2*4, 32*8+3*4, 32*8+4*4, 32*8+5*4, 32*8+6*4, 32*8+7*4,
  565.             128*8+0*4, 128*8+1*4, 128*8+2*4, 128*8+3*4, 128*8+4*4, 128*8+5*4, 128*8+6*4, 128*8+7*4,
  566.             160*8+0*4, 160*8+1*4, 160*8+2*4, 160*8+3*4, 160*8+4*4, 160*8+5*4, 160*8+6*4, 160*8+7*4 },
  567.     { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
  568.             16*32, 17*32, 18*32, 19*32, 20*32, 21*32, 22*32, 23*32,
  569.             64*32, 65*32, 66*32, 67*32, 68*32, 69*32, 70*32, 71*32,
  570.             80*32, 81*32, 82*32, 83*32, 84*32, 85*32, 86*32, 87*32 },
  571.     512*8    /* every sprite takes 512 consecutive bytes */
  572. };
  573.  
  574. static struct GfxLayout silkworm_spritelayout8x8 =
  575. {
  576.     8,8,    /* 8*8 xprites */
  577.     8192,    /* 8192 sprites */
  578.     4,        /* 4 bits per pixel */
  579.     { 0, 1, 2, 3 },    /* the bitplanes are packed in one nibble */
  580.     { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 },
  581.     { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
  582.     32*8    /* every sprite takes 32 consecutive bytes */
  583. };
  584.  
  585. /* the only difference in rygar_spritelayout is that half as many sprites are present */
  586.  
  587. static struct GfxLayout rygar_spritelayout = /* only difference is half as many sprites as silkworm */
  588. {
  589.     16,16,    /* 16*16 sprites */
  590.     1024,    /* 1024 sprites */
  591.     4,    /* 4 bits per pixel */
  592.     { 0, 1, 2, 3 },    /* the bitplanes are packed in one nibble */
  593.     { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,
  594.             32*8+0*4, 32*8+1*4, 32*8+2*4, 32*8+3*4, 32*8+4*4, 32*8+5*4, 32*8+6*4, 32*8+7*4 },
  595.     { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
  596.             16*32, 17*32, 18*32, 19*32, 20*32, 21*32, 22*32, 23*32 },
  597.     128*8    /* every sprite takes 128 consecutive bytes */
  598. };
  599.  
  600. static struct GfxLayout rygar_spritelayout2x =
  601. {
  602.     32,32,    /* 32*32 sprites */
  603.     256,    /* 512 sprites */
  604.     4,    /* 4 bits per pixel */
  605.     { 0, 1, 2, 3 },    /* the bitplanes are packed in one nibble */
  606.     { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,
  607.             32*8+0*4, 32*8+1*4, 32*8+2*4, 32*8+3*4, 32*8+4*4, 32*8+5*4, 32*8+6*4, 32*8+7*4,
  608.             128*8+0*4, 128*8+1*4, 128*8+2*4, 128*8+3*4, 128*8+4*4, 128*8+5*4, 128*8+6*4, 128*8+7*4,
  609.             160*8+0*4, 160*8+1*4, 160*8+2*4, 160*8+3*4, 160*8+4*4, 160*8+5*4, 160*8+6*4, 160*8+7*4 },
  610.     { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
  611.             16*32, 17*32, 18*32, 19*32, 20*32, 21*32, 22*32, 23*32,
  612.             64*32, 65*32, 66*32, 67*32, 68*32, 69*32, 70*32, 71*32,
  613.             80*32, 81*32, 82*32, 83*32, 84*32, 85*32, 86*32, 87*32 },
  614.     512*8    /* every sprite takes 512 consecutive bytes */
  615. };
  616.  
  617. static struct GfxLayout rygar_spritelayout8x8 =
  618. {
  619.     8,8,    /* 8*8 xprites */
  620.     4096,    /* 8192 sprites */
  621.     4,        /* 4 bits per pixel */
  622.     { 0, 1, 2, 3 },    /* the bitplanes are packed in one nibble */
  623.     { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 },
  624.     { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
  625.     32*8    /* every sprite takes 32 consecutive bytes */
  626. };
  627.  
  628. static struct GfxDecodeInfo gfxdecodeinfo[] =
  629. {
  630.     { REGION_GFX1, 0, &tecmo_charlayout,        256, 16 },    /* colors 256 - 511 */
  631.     { REGION_GFX2, 0, &silkworm_spritelayout8x8,  0, 16 },    /* colors   0 - 255 */
  632.     { REGION_GFX2, 0, &silkworm_spritelayout,     0, 16 },    /* 16x16 sprites */
  633.     { REGION_GFX2, 0, &silkworm_spritelayout2x,   0, 16 },    /* double size hack */
  634.     { REGION_GFX3, 0, &silkworm_spritelayout,   512, 16 },    /* bg#1 colors 512 - 767 */
  635.     { REGION_GFX4, 0, &silkworm_spritelayout,   768, 16 },    /* bg#2 colors 768 - 1023 */
  636.     { -1 } /* end of array */
  637. };
  638.  
  639. static struct GfxDecodeInfo rygar_gfxdecodeinfo[] =
  640. {
  641.     { REGION_GFX1, 0, &tecmo_charlayout,     256, 16 },    /* colors 256 - 511 */
  642.     { REGION_GFX2, 0, &rygar_spritelayout8x8,  0, 16 },    /* colors   0 - 255 */
  643.     { REGION_GFX2, 0, &rygar_spritelayout,     0, 16 },    /* 16x16 sprites */
  644.     { REGION_GFX2, 0, &rygar_spritelayout2x,   0, 16 },    /* double size hack */
  645.     { REGION_GFX3, 0, &rygar_spritelayout,   512, 16 },    /* bg#1 colors 512 - 767 */
  646.     { REGION_GFX4, 0, &rygar_spritelayout,   768, 16 },    /* bg#2 colors 768 - 1023 */
  647.     { -1 } /* end of array */
  648. };
  649.  
  650.  
  651.  
  652. static struct YM3526interface rygar_ym3812_interface =
  653. {
  654.     1,            /* 1 chip (no more supported) */
  655.     4000000,    /* 4 MHz ? */
  656.     { 255 }        /* (not supported) */
  657. };
  658.  
  659. static struct YM3526interface ym3812_interface =
  660. {
  661.     1,            /* 1 chip (no more supported) */
  662.     4000000,    /* 4 MHz ? */
  663.     { 255 }        /* (not supported) */
  664. };
  665.  
  666. /* ADPCM chip is a MSM5205 @ 400kHz */
  667. static struct ADPCMinterface adpcm_interface =
  668. {
  669.     1,            /* 1 channel */
  670.     8333,       /* 8000Hz playback */
  671.     REGION_SOUND1,    /* memory region 3 */
  672.     0,            /* init function */
  673.     { 255 }
  674. };
  675.  
  676.  
  677.  
  678. static struct MachineDriver machine_driver_silkworm =
  679. {
  680.     /* basic machine hardware */
  681.     {
  682.         {
  683.             CPU_Z80,
  684.             7600000,    /* 7.6 Mhz (?????) */
  685.             readmem,silkworm_writemem,0,0,
  686.             interrupt,1
  687.         },
  688.         {
  689.             CPU_Z80 | CPU_AUDIO_CPU,
  690.             4000000,    /* 4 MHz ???? */
  691.             sound_readmem,sound_writemem,0,0,
  692.             interrupt,2    /* ?? */
  693.                         /* NMIs are triggered by the main CPU */
  694.         }
  695.     },
  696.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  697.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  698.     0,
  699.  
  700.     /* video hardware */
  701.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  702.     gfxdecodeinfo,
  703.     1024, 1024,
  704.     0,
  705.  
  706.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  707.     0,
  708.     silkworm_vh_start,
  709.     tecmo_vh_stop,
  710.     tecmo_vh_screenrefresh,
  711.  
  712.     /* sound hardware */
  713.     0,0,0,0,
  714.     {
  715.         {
  716.             SOUND_YM3812,
  717.             &ym3812_interface
  718.         },
  719.         {
  720.             SOUND_ADPCM,
  721.             &adpcm_interface
  722.         }
  723.     }
  724. };
  725.  
  726. static struct MachineDriver machine_driver_rygar =
  727. {
  728.     /* basic machine hardware */
  729.     {
  730.         {
  731.             CPU_Z80,
  732.             7600000,
  733.             readmem,rygar_writemem,0,0,
  734.             interrupt,1
  735.         },
  736.         {
  737.             CPU_Z80 | CPU_AUDIO_CPU,
  738.             4000000,    /* 4 MHz ???? */
  739.             rygar_sound_readmem,rygar_sound_writemem,0,0,
  740.             interrupt,2    /* ?? */
  741.                         /* NMIs are triggered by the main CPU */
  742.         }
  743.     },
  744.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  745.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  746.     0,
  747.  
  748.     /* video hardware */
  749.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  750.     rygar_gfxdecodeinfo,
  751.     1024, 1024,
  752.     0,
  753.  
  754.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  755.     0,
  756.     rygar_vh_start,
  757.     tecmo_vh_stop,
  758.     tecmo_vh_screenrefresh,
  759.  
  760.     /* sound hardware */
  761.     0,0,0,0,
  762.     {
  763.         {
  764.             SOUND_YM3812,
  765.             &rygar_ym3812_interface
  766.         },
  767.         {
  768.             SOUND_ADPCM,
  769.             &adpcm_interface
  770.         },
  771.     }
  772. };
  773.  
  774. static struct MachineDriver machine_driver_gemini =
  775. {
  776.     /* basic machine hardware */
  777.     {
  778.         {
  779.             CPU_Z80,
  780.             7600000,    /* 7.6 Mhz (?????) */
  781.             readmem,gemini_writemem,0,0,
  782.             interrupt,1
  783.         },
  784.         {
  785.             CPU_Z80 | CPU_AUDIO_CPU,
  786.             4000000,    /* 4 MHz ???? */
  787.             sound_readmem,sound_writemem,0,0,
  788.             interrupt,2    /* ?? */
  789.                         /* NMIs are triggered by the main CPU */
  790.         }
  791.     },
  792.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  793.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  794.     0,
  795.  
  796.     /* video hardware */
  797.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  798.     gfxdecodeinfo,
  799.     1024, 1024,
  800.     0,
  801.  
  802.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  803.     0,
  804.     gemini_vh_start,
  805.     tecmo_vh_stop,
  806.     tecmo_vh_screenrefresh,
  807.  
  808.     /* sound hardware */
  809.     0,0,0,0,
  810.     {
  811.         {
  812.             SOUND_YM3812,
  813.             &ym3812_interface
  814.         },
  815.         {
  816.             SOUND_ADPCM,
  817.             &adpcm_interface
  818.         }
  819.     }
  820. };
  821.  
  822.  
  823.  
  824. /***************************************************************************
  825.  
  826.   Game driver(s)
  827.  
  828. ***************************************************************************/
  829.  
  830. ROM_START( rygar )
  831.     ROM_REGION( 0x18000, REGION_CPU1 )    /* 64k for code */
  832.     ROM_LOAD( "5.5p",         0x00000, 0x08000, 0x062cd55d ) /* code */
  833.     ROM_LOAD( "cpu_5m.bin",   0x08000, 0x04000, 0x7ac5191b ) /* code */
  834.     ROM_LOAD( "cpu_5j.bin",   0x10000, 0x08000, 0xed76d606 ) /* banked at f000-f7ff */
  835.  
  836.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  837.     ROM_LOAD( "cpu_4h.bin",   0x0000, 0x2000, 0xe4a2fa87 )
  838.  
  839.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  840.     ROM_LOAD( "cpu_8k.bin",   0x00000, 0x08000, 0x4d482fb6 )    /* characters */
  841.  
  842.     ROM_REGION( 0x20000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  843.     ROM_LOAD( "vid_6k.bin",   0x00000, 0x08000, 0xaba6db9e )    /* sprites */
  844.     ROM_LOAD( "vid_6j.bin",   0x08000, 0x08000, 0xae1f2ed6 )    /* sprites */
  845.     ROM_LOAD( "vid_6h.bin",   0x10000, 0x08000, 0x46d9e7df )    /* sprites */
  846.     ROM_LOAD( "vid_6g.bin",   0x18000, 0x08000, 0x45839c9a )    /* sprites */
  847.  
  848.     ROM_REGION( 0x20000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  849.     ROM_LOAD( "vid_6p.bin",   0x00000, 0x08000, 0x9eae5f8e )
  850.     ROM_LOAD( "vid_6o.bin",   0x08000, 0x08000, 0x5a10a396 )
  851.     ROM_LOAD( "vid_6n.bin",   0x10000, 0x08000, 0x7b12cf3f )
  852.     ROM_LOAD( "vid_6l.bin",   0x18000, 0x08000, 0x3cea7eaa )
  853.  
  854.     ROM_REGION( 0x20000, REGION_GFX4 | REGIONFLAG_DISPOSE )
  855.     ROM_LOAD( "vid_6f.bin",   0x00000, 0x08000, 0x9840edd8 )
  856.     ROM_LOAD( "vid_6e.bin",   0x08000, 0x08000, 0xff65e074 )
  857.     ROM_LOAD( "vid_6c.bin",   0x10000, 0x08000, 0x89868c85 )
  858.     ROM_LOAD( "vid_6b.bin",   0x18000, 0x08000, 0x35389a7b )
  859.  
  860.     ROM_REGION( 0x4000, REGION_SOUND1 )    /* ADPCM samples */
  861.     ROM_LOAD( "cpu_1f.bin",   0x0000, 0x4000, 0x3cc98c5a )
  862. ROM_END
  863.  
  864. ROM_START( rygar2 )
  865.     ROM_REGION( 0x18000, REGION_CPU1 )    /* 64k for code */
  866.     ROM_LOAD( "cpu_5p.bin",   0x00000, 0x08000, 0xe79c054a ) /* code */
  867.     ROM_LOAD( "cpu_5m.bin",   0x08000, 0x04000, 0x7ac5191b ) /* code */
  868.     ROM_LOAD( "cpu_5j.bin",   0x10000, 0x08000, 0xed76d606 ) /* banked at f000-f7ff */
  869.  
  870.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  871.     ROM_LOAD( "cpu_4h.bin",   0x0000, 0x2000, 0xe4a2fa87 )
  872.  
  873.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  874.     ROM_LOAD( "cpu_8k.bin",   0x00000, 0x08000, 0x4d482fb6 )    /* characters */
  875.  
  876.     ROM_REGION( 0x20000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  877.     ROM_LOAD( "vid_6k.bin",   0x00000, 0x08000, 0xaba6db9e )    /* sprites */
  878.     ROM_LOAD( "vid_6j.bin",   0x08000, 0x08000, 0xae1f2ed6 )    /* sprites */
  879.     ROM_LOAD( "vid_6h.bin",   0x10000, 0x08000, 0x46d9e7df )    /* sprites */
  880.     ROM_LOAD( "vid_6g.bin",   0x18000, 0x08000, 0x45839c9a )    /* sprites */
  881.  
  882.     ROM_REGION( 0x20000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  883.     ROM_LOAD( "vid_6p.bin",   0x00000, 0x08000, 0x9eae5f8e )
  884.     ROM_LOAD( "vid_6o.bin",   0x08000, 0x08000, 0x5a10a396 )
  885.     ROM_LOAD( "vid_6n.bin",   0x10000, 0x08000, 0x7b12cf3f )
  886.     ROM_LOAD( "vid_6l.bin",   0x18000, 0x08000, 0x3cea7eaa )
  887.  
  888.     ROM_REGION( 0x20000, REGION_GFX4 | REGIONFLAG_DISPOSE )
  889.     ROM_LOAD( "vid_6f.bin",   0x00000, 0x08000, 0x9840edd8 )
  890.     ROM_LOAD( "vid_6e.bin",   0x08000, 0x08000, 0xff65e074 )
  891.     ROM_LOAD( "vid_6c.bin",   0x10000, 0x08000, 0x89868c85 )
  892.     ROM_LOAD( "vid_6b.bin",   0x18000, 0x08000, 0x35389a7b )
  893.  
  894.     ROM_REGION( 0x4000, REGION_SOUND1 )    /* ADPCM samples */
  895.     ROM_LOAD( "cpu_1f.bin",   0x0000, 0x4000, 0x3cc98c5a )
  896. ROM_END
  897.  
  898. ROM_START( rygarj )
  899.     ROM_REGION( 0x18000, REGION_CPU1 )    /* 64k for code */
  900.  
  901.     ROM_LOAD( "cpuj_5p.bin",  0x00000, 0x08000, 0xb39698ba ) /* code */
  902.     ROM_LOAD( "cpuj_5m.bin",  0x08000, 0x04000, 0x3f180979 ) /* code */
  903.     ROM_LOAD( "cpuj_5j.bin",  0x10000, 0x08000, 0x69e44e8f ) /* banked at f000-f7ff */
  904.  
  905.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  906.     ROM_LOAD( "cpu_4h.bin",   0x0000, 0x2000, 0xe4a2fa87 )
  907.  
  908.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  909.     ROM_LOAD( "cpuj_8k.bin",  0x00000, 0x08000, 0x45047707 )    /* characters */
  910.  
  911.     ROM_REGION( 0x20000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  912.     ROM_LOAD( "vid_6k.bin",   0x00000, 0x08000, 0xaba6db9e )    /* sprites */
  913.     ROM_LOAD( "vid_6j.bin",   0x08000, 0x08000, 0xae1f2ed6 )    /* sprites */
  914.     ROM_LOAD( "vid_6h.bin",   0x10000, 0x08000, 0x46d9e7df )    /* sprites */
  915.     ROM_LOAD( "vid_6g.bin",   0x18000, 0x08000, 0x45839c9a )    /* sprites */
  916.  
  917.     ROM_REGION( 0x20000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  918.     ROM_LOAD( "vid_6p.bin",   0x00000, 0x08000, 0x9eae5f8e )
  919.     ROM_LOAD( "vid_6o.bin",   0x08000, 0x08000, 0x5a10a396 )
  920.     ROM_LOAD( "vid_6n.bin",   0x10000, 0x08000, 0x7b12cf3f )
  921.     ROM_LOAD( "vid_6l.bin",   0x18000, 0x08000, 0x3cea7eaa )
  922.  
  923.     ROM_REGION( 0x20000, REGION_GFX4 | REGIONFLAG_DISPOSE )
  924.     ROM_LOAD( "vid_6f.bin",   0x00000, 0x08000, 0x9840edd8 )
  925.     ROM_LOAD( "vid_6e.bin",   0x08000, 0x08000, 0xff65e074 )
  926.     ROM_LOAD( "vid_6c.bin",   0x10000, 0x08000, 0x89868c85 )
  927.     ROM_LOAD( "vid_6b.bin",   0x18000, 0x08000, 0x35389a7b )
  928.  
  929.     ROM_REGION( 0x4000, REGION_SOUND1 )    /* ADPCM samples */
  930.     ROM_LOAD( "cpu_1f.bin",   0x0000, 0x4000, 0x3cc98c5a )
  931. ROM_END
  932.  
  933. ROM_START( silkworm )
  934.     ROM_REGION( 0x20000, REGION_CPU1 )    /* 64k for code */
  935.     ROM_LOAD( "silkworm.4",   0x00000, 0x10000, 0xa5277cce )    /* c000-ffff is not used */
  936.     ROM_LOAD( "silkworm.5",   0x10000, 0x10000, 0xa6c7bb51 )    /* banked at f000-f7ff */
  937.  
  938.     ROM_REGION( 0x20000, REGION_CPU2 )    /* 64k for the audio CPU */
  939.     ROM_LOAD( "silkworm.3",   0x0000, 0x8000, 0xb589f587 )
  940.  
  941.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  942.     ROM_LOAD( "silkworm.2",   0x00000, 0x08000, 0xe80a1cd9 )    /* characters */
  943.  
  944.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  945.     ROM_LOAD( "silkworm.6",   0x00000, 0x10000, 0x1138d159 )    /* sprites */
  946.     ROM_LOAD( "silkworm.7",   0x10000, 0x10000, 0xd96214f7 )    /* sprites */
  947.     ROM_LOAD( "silkworm.8",   0x20000, 0x10000, 0x0494b38e )    /* sprites */
  948.     ROM_LOAD( "silkworm.9",   0x30000, 0x10000, 0x8ce3cdf5 )    /* sprites */
  949.  
  950.     ROM_REGION( 0x40000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  951.     ROM_LOAD( "silkworm.10",  0x00000, 0x10000, 0x8c7138bb )    /* tiles #1 */
  952.     ROM_LOAD( "silkworm.11",  0x10000, 0x10000, 0x6c03c476 )    /* tiles #1 */
  953.     ROM_LOAD( "silkworm.12",  0x20000, 0x10000, 0xbb0f568f )    /* tiles #1 */
  954.     ROM_LOAD( "silkworm.13",  0x30000, 0x10000, 0x773ad0a4 )    /* tiles #1 */
  955.  
  956.     ROM_REGION( 0x40000, REGION_GFX4 | REGIONFLAG_DISPOSE )
  957.     ROM_LOAD( "silkworm.14",  0x00000, 0x10000, 0x409df64b )    /* tiles #2 */
  958.     ROM_LOAD( "silkworm.15",  0x10000, 0x10000, 0x6e4052c9 )    /* tiles #2 */
  959.     ROM_LOAD( "silkworm.16",  0x20000, 0x10000, 0x9292ed63 )    /* tiles #2 */
  960.     ROM_LOAD( "silkworm.17",  0x30000, 0x10000, 0x3fa4563d )    /* tiles #2 */
  961.  
  962.     ROM_REGION( 0x8000, REGION_SOUND1 )    /* ADPCM samples */
  963.     ROM_LOAD( "silkworm.1",   0x0000, 0x8000, 0x5b553644 )
  964. ROM_END
  965.  
  966. ROM_START( silkwrm2 )
  967.     ROM_REGION( 0x20000, REGION_CPU1 )    /* 64k for code */
  968.     ROM_LOAD( "r4",           0x00000, 0x10000, 0x6df3df22 )    /* c000-ffff is not used */
  969.     ROM_LOAD( "silkworm.5",   0x10000, 0x10000, 0xa6c7bb51 )    /* banked at f000-f7ff */
  970.  
  971.     ROM_REGION( 0x20000, REGION_CPU2 )    /* 64k for the audio CPU */
  972.     ROM_LOAD( "r3",           0x0000, 0x8000, 0xb79848d0 )
  973.  
  974.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  975.     ROM_LOAD( "silkworm.2",   0x00000, 0x08000, 0xe80a1cd9 )    /* characters */
  976.  
  977.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  978.     ROM_LOAD( "silkworm.6",   0x00000, 0x10000, 0x1138d159 )    /* sprites */
  979.     ROM_LOAD( "silkworm.7",   0x10000, 0x10000, 0xd96214f7 )    /* sprites */
  980.     ROM_LOAD( "silkworm.8",   0x20000, 0x10000, 0x0494b38e )    /* sprites */
  981.     ROM_LOAD( "silkworm.9",   0x30000, 0x10000, 0x8ce3cdf5 )    /* sprites */
  982.  
  983.     ROM_REGION( 0x40000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  984.     ROM_LOAD( "silkworm.10",  0x00000, 0x10000, 0x8c7138bb )    /* tiles #1 */
  985.     ROM_LOAD( "silkworm.11",  0x10000, 0x10000, 0x6c03c476 )    /* tiles #1 */
  986.     ROM_LOAD( "silkworm.12",  0x20000, 0x10000, 0xbb0f568f )    /* tiles #1 */
  987.     ROM_LOAD( "silkworm.13",  0x30000, 0x10000, 0x773ad0a4 )    /* tiles #1 */
  988.  
  989.     ROM_REGION( 0x40000, REGION_GFX4 | REGIONFLAG_DISPOSE )
  990.     ROM_LOAD( "silkworm.14",  0x00000, 0x10000, 0x409df64b )    /* tiles #2 */
  991.     ROM_LOAD( "silkworm.15",  0x10000, 0x10000, 0x6e4052c9 )    /* tiles #2 */
  992.     ROM_LOAD( "silkworm.16",  0x20000, 0x10000, 0x9292ed63 )    /* tiles #2 */
  993.     ROM_LOAD( "silkworm.17",  0x30000, 0x10000, 0x3fa4563d )    /* tiles #2 */
  994.  
  995.     ROM_REGION( 0x8000, REGION_SOUND1 )    /* ADPCM samples */
  996.     ROM_LOAD( "silkworm.1",   0x0000, 0x8000, 0x5b553644 )
  997. ROM_END
  998.  
  999. ROM_START( gemini )
  1000.     ROM_REGION( 0x20000, REGION_CPU1 )    /* 64k for code */
  1001.     ROM_LOAD( "gw04-5s.rom",  0x00000, 0x10000, 0xff9de855 )    /* c000-ffff is not used */
  1002.     ROM_LOAD( "gw05-6s.rom",  0x10000, 0x10000, 0x5a6947a9 )    /* banked at f000-f7ff */
  1003.  
  1004.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1005.     ROM_LOAD( "gw03-5h.rom",  0x0000, 0x8000, 0x9bc79596 )
  1006.  
  1007.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1008.     ROM_LOAD( "gw02-3h.rom",  0x00000, 0x08000, 0x7acc8d35 )    /* characters */
  1009.  
  1010.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  1011.     ROM_LOAD( "gw06-1c.rom",  0x00000, 0x10000, 0x4ea51631 )    /* sprites */
  1012.     ROM_LOAD( "gw07-1d.rom",  0x10000, 0x10000, 0xda42637e )    /* sprites */
  1013.     ROM_LOAD( "gw08-1f.rom",  0x20000, 0x10000, 0x0b4e8d70 )    /* sprites */
  1014.     ROM_LOAD( "gw09-1h.rom",  0x30000, 0x10000, 0xb65c5e4c )    /* sprites */
  1015.  
  1016.     ROM_REGION( 0x40000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  1017.     ROM_LOAD( "gw10-1n.rom",  0x00000, 0x10000, 0x5e84cd4f )    /* tiles #1 */
  1018.     ROM_LOAD( "gw11-2na.rom", 0x10000, 0x10000, 0x08b458e1 )    /* tiles #1 */
  1019.     ROM_LOAD( "gw12-2nb.rom", 0x20000, 0x10000, 0x229c9714 )    /* tiles #1 */
  1020.     ROM_LOAD( "gw13-3n.rom",  0x30000, 0x10000, 0xc5dfaf47 )    /* tiles #1 */
  1021.  
  1022.     ROM_REGION( 0x40000, REGION_GFX4 | REGIONFLAG_DISPOSE )
  1023.     ROM_LOAD( "gw14-1r.rom",  0x00000, 0x10000, 0x9c10e5b5 )    /* tiles #2 */
  1024.     ROM_LOAD( "gw15-2ra.rom", 0x10000, 0x10000, 0x4cd18cfa )    /* tiles #2 */
  1025.     ROM_LOAD( "gw16-2rb.rom", 0x20000, 0x10000, 0xf911c7be )    /* tiles #2 */
  1026.     ROM_LOAD( "gw17-3r.rom",  0x30000, 0x10000, 0x79a9ce25 )    /* tiles #2 */
  1027.  
  1028.     ROM_REGION( 0x8000, REGION_SOUND1 )    /* ADPCM samples */
  1029.     ROM_LOAD( "gw01-6a.rom",  0x0000, 0x8000, 0xd78afa05 )
  1030. ROM_END
  1031.  
  1032.  
  1033.  
  1034. GAMEX( 1986, rygar,    0,        rygar,    rygar,    0, ROT0,  "Tecmo", "Rygar (US set 1)", GAME_NO_COCKTAIL )
  1035. GAMEX( 1986, rygar2,   rygar,    rygar,    rygar,    0, ROT0,  "Tecmo", "Rygar (US set 2)", GAME_NO_COCKTAIL )
  1036. GAMEX( 1986, rygarj,   rygar,    rygar,    rygar,    0, ROT0,  "Tecmo", "Argus no Senshi (Japan)", GAME_NO_COCKTAIL )
  1037. GAMEX( 1987, gemini,   0,        gemini,   gemini,   0, ROT90, "Tecmo", "Gemini Wing", GAME_NO_COCKTAIL )
  1038. GAMEX( 1988, silkworm, 0,        silkworm, silkworm, 0, ROT0,  "Tecmo", "Silkworm (set 1)", GAME_NO_COCKTAIL )
  1039. GAMEX( 1988, silkwrm2, silkworm, silkworm, silkworm, 0, ROT0,  "Tecmo", "Silkworm (set 2)", GAME_NO_COCKTAIL )
  1040.